package com.sram.service;

import com.sram.dao.BaseDao;
import com.sram.dao.UserDao;
import com.sram.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * Created by Administrator on 2017/2/17.
 */
public abstract class BaseService {
    @Resource
    private BaseDao baseDao;
    public void add(Object obj) throws Exception {
        baseDao.add(obj);
    }
    public void delUser( Object  obj) throws Exception {
        baseDao.delete(obj);
    }
    public void deleteById( Class userClass, Serializable id) throws Exception {
        baseDao.deleteById(userClass,id);
    }
    public  Object  findByid(Class userClass, Serializable id) throws Exception {
        Object  obj  =baseDao.findByid(userClass,id);
        return obj;
    }
    public  List  getAll(String className) throws Exception {
        List  ss =baseDao.getAll(className);
        return ss;
    }
    public void update( Object  obj) throws Exception {
        baseDao.update(obj);
    }

    public   List getByParam(String queryString, Object[] values){
       return baseDao.getByParam(queryString,values);
    };
}
